Skip to main content

caseSensitive

Type

property

Summary

Specifies whether comparisons treat uppercase and lowercase letters as different.

Syntax

set the caseSensitive to {true | false}

Description

Use the caseSensitive property to control the behavior of text comparisons.

The caseSensitive property controls the behavior of the all string comparisons, including the comparison operators =, >, <, >=, <=, is in, is among, is not among, and contains; the commands filter, find, and replace; and the functions offset, itemOffset, wordOffset, lineOffset, and replaceText.

If the caseSensitive property is set to true, all the LiveCode terms listed above, as well as all other string comparisons, treat uppercase and lowercase letters as different. For example, a search for "Apple" does not find the string "apple" or "APPLE", and the expression "APPLE" = "apple" evaluates to false.

If the caseSensitive is false, uppercase letters are treated as equal to their lowercase equivalents: a search for "Apple" finds strings such as "apple" or "APPLE" without paying attention to the case of each letter, and the expression "APPLE" = "apple" evaluates to true.

The caseSensitive also affects custom property names and array key names. If the caseSensitive is true, custom property names that differ only in the case of their letters are treated as different custom properties. If the caseSensitive is false, custom property names that differ only in letter case cannot be distinguished from each other. The same is true for the keys of array elements.

Since the caseSensitive is a local property, its value is reset to false when the current handler finishes executing. It retains its value only for the current handler, and setting it in one handler does not affect its value in other handlers it calls.

Important

Messages, object names, and LiveCode terms are never treated as case-sensitive, even if the caseSensitive is set to true.

Examples

set the caseSensitive to true

command: replace, find, filter, reset

function: wordOffset, offset, value, lineOffset, replaceText, keys, itemOffset

glossary: object, element, call, property, evaluate, behavior, operator, case-sensitive, array, execute, expression, command, function, LiveCode, custom property, key, message, handler

keyword: string

operator: equals, contains, greater-than, greater-than-or-equals, is among, is not among, less than, less-than-or-equals, is in

property: wholeMatches

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?